// Copyright (C) 2009 Littlebear
// This file is part of the "Irrlicht Engine Plus".
// For conditions of distribution and use, see copyright notice in irrlicht.h

#ifndef __C_PARTICLE_SIZE_AFFECTOR_H_INCLUDED__
#define __C_PARTICLE_SIZE_AFFECTOR_H_INCLUDED__

#include "IParticleSizeAffector.h"

namespace irr
{
namespace scene
{

class CParticleSizeAffector : public irr::scene::IParticleSizeAffector
{
public:

	CParticleSizeAffector(f32 size = 1.0f);

	//! Affects a particle.
	virtual void affect(u32 now, SParticle* particlearray, u32 count);

	//! gets the size
	virtual f32 getSize(){ return Size; }

	//! sets the size
	virtual void setSize(f32 size)
	{
		Size = size; 
	}

	//! Writes attributes of the object.
	//! Implement this to expose the attributes of your scene node animator for 
	//! scripting languages, editors, debuggers or xml serialization purposes.
	virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;

	//! Reads attributes of the object.
	//! Implement this to set the attributes of your scene node animator for 
	//! scripting languages, editors, debuggers or xml deserialization purposes.
	//! \param startIndex: start index where to start reading attributes.
	//! \return: returns last index of an attribute read by this affector
	virtual s32 deserializeAttributes(s32 startIndex, io::IAttributes* in, io::SAttributeReadWriteOptions* options);

private:
	f32 Size;	//!size

};

} // end namespace scene
} // end namespace irr

#endif	//__C_PARTICLE_SIZE_AFFECTOR_H_INCLUDED__
